limsProductCondition.editConditionPage = {

    getGridParam: function () {
        var _this = this, columns = limsProductCondition.getConditionColumns(), requestData = this.param;
        this.param.single ? columns.unshift({
            radio: true
        }) : columns.unshift({
            checkbox: true
        });
        return {
            type: 'grid',
            id: 'product-condition-choose-list-grid',
            url: limsProductCondition.baseUrl + '/queries/columns',
            requestData: requestData,
            service: 'limsProductConditionServiceImpl',
            columns: columns
        }
    },

    getBtnToolbarParam: function () {
        var _this = this;
        return {
            type: 'btnToolbar',
            items: [{
                type: 'btnGroup',
                items: [{
                    type: 'button',
                    text: 'GIKAM.BUTTON.CONFIRM',
                    icon: 'select',
                    onClick: function () {
                        Gikam.getLastModal().close(Gikam.getComp('product-condition-choose-list-grid').getSelections());
                    }
                }, {
                    type: 'button',
                    text: 'GIKAM.BUTTON.CANCEL',
                    icon: 'cancel',
                    onClick: function () {
                        Gikam.getLastModal().close();
                    }
                }]
            }]
        }
    },

    create: function () {
        var _this = this;
        Gikam.create('layout', {
            renderTo: Gikam.getLastModal().window.$dom,
            center: {
                items: [this.getBtnToolbarParam(), this.getGridParam()]
            }
        });
    },

    init: function (param) {
        this.param = param;
        this.create();
    }
}